﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Chaos.messages
{
    class factory : stream.factory
    {
        model.factory m_modelfactory = new model.factory();

        public stream.streamable create(String in_Name)
        {
            if (in_Name == "request_user_info")
            {
                return new request_user_info();
            }

            if (in_Name == "process_user_info")
            {
                return new process_user_info();
            }

            if (in_Name == "process_user_info_change")
            {
                return new process_user_info_change();
            }

            if (in_Name == "request_server_info")
            {
                return new request_server_info();
            }

            if (in_Name == "process_server_info")
            {
                return new process_server_info();
            }

            if (in_Name == "request_chat_text")
            {
                return new request_chat_text();
            }

            if (in_Name == "process_chat_text")
            {
                return new process_chat_text();
            }

            if (in_Name == "request_model_game")
            {
                return new request_model_game();
            }

            if (in_Name == "process_model_game")
            {
                return new process_model_game();
            }

            if (in_Name == "request_model_appinfo")
            {
                return new request_model_appinfo();
            }

            if (in_Name == "process_model_appinfo")
            {
                return new process_model_appinfo();
            }

            if (in_Name == "request_assign_faction")
            {
                return new request_assign_faction();
            }

            if (in_Name == "request_lock_faction")
            {
                return new request_lock_faction();
            }

            if (in_Name == "request_assign_factions_randomly")
            {
                return new request_assign_factions_randomly();
            }

            if (in_Name == "request_start_game")
            {
                return new request_start_game();
            }

            if (in_Name == "process_start_game")
            {
                return new process_start_game();
            }

            if (in_Name == "request_change_powersheet")
            {
                return new request_change_powersheet();
            }
            
            return m_modelfactory.create(in_Name);
        }
    }
}
